#include<iostream>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<string>

using namespace std;
int main()
{
	//观察扩容情况 -- 1.5倍扩容
	string s;
	cout << sizeof(s) << endl; //28个字节,所以容量上来就是32,看上面的类
	size_t sz = s.capacity();
	cout << "making s grow:\n";
	for (int i = 0; i < 100; i++)
	{
		s.push_back('c');
		if (sz != s.capacity())
		{
			sz = s.capacity();
			cout << "capacity changed: " << sz << '\n';
		}
	}
    return 0;
}
